//
//  MoneyRecordCell.m
//  TenThousand
//
//  Created by 我的 on 16/6/22.
//  Copyright © 2016年 baixue. All rights reserved.
//

#import "MoneyRecordCell.h"

@implementation MoneyRecordCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        
        _timer = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, Screen_Width/5*2, 40)];
        _money = [[UILabel alloc] initWithFrame:CGRectMake(Screen_Width/5 *2, 0,Screen_Width/5, 40)];
        _type = [[UILabel alloc] initWithFrame:CGRectMake(Screen_Width/5 *3, 0, Screen_Width/5, 40)];
        _state = [[UILabel alloc] initWithFrame:CGRectMake(Screen_Width/5 *4, 0, Screen_Width/5, 40)];
        
        [self.contentView addSubview:_timer];
        [self.contentView addSubview:_money];
        [self.contentView addSubview:_type];
        [self.contentView addSubview:_state];
        
        _timer.text = @" 2016-02-13 11:30:21";
        _money.text = @"5000.00元";
        _type.text = @"本金";
        _state.text = @"放款成功";
        _state.textColor = [UIColor colorWithRed:0.93 green:0.34 blue:0.22 alpha:1.00];
        
        
        _timer.textAlignment = NSTextAlignmentCenter;
        _money.textAlignment = NSTextAlignmentCenter;
        _type.textAlignment = NSTextAlignmentCenter;
        _state.textAlignment = NSTextAlignmentCenter;
        
        if (Screen_Width == 320) {
            _timer.font = [UIFont systemFontOfSize:12.0f];
            _money.font = [UIFont systemFontOfSize:12.0f];
            _type.font = [UIFont systemFontOfSize:12.0f];
            _state.font = [UIFont systemFontOfSize:12.0f];
        }else{
            _timer.font = [UIFont systemFontOfSize:14.0f];
            _money.font = [UIFont systemFontOfSize:14.0f];
            _type.font = [UIFont systemFontOfSize:14.0f];
            _state.font = [UIFont systemFontOfSize:14.0f];

        }
        
    }
    return self;
    
}


//cell赋值
- (void)setDataWithModel:(MoneyRecordModel *)model{
    
    _timer.text = [NSString stringWithFormat:@"%@",model.AddDate];//时间
    _money.text = [NSString stringWithFormat:@"%@",model.Amount];//金额
    _state.text = [NSString stringWithFormat:@"%@",model.State];//类型
    _type.text = [NSString stringWithFormat:@"%@",model.OrderType];//状态
    
}



@end
